<?php
/**
 * Created by PhpStorm
 * User: whh
 * Date: 2022/7/28
 * Time: 16:02
 */

namespace app\common\model;


use think\Model;

class TaskConfig extends Model
{
    protected $table = 'quick_task_config';

    public static function defaultTemplate($quickId)
    {
        if (!$quickId) {
            return [];
        }
        return [
            'add_desktop' => [
                'key' => 'add_desktop',
                'title' => '保存至手机桌面',
                'desc' => '防走丢',
                'point' => 20,
                'display' => 1,
                'sort' => 1,
            ],
            'bind_number' => [
                'key' => 'bind_number',
                'title' => '绑定手机号',
                'desc' => '绑定手机号，账户更安全',
                'point' => 20,
                'display' => 1,
                'sort' => 2,
            ],
            'calendar' => [
                'key' => 'calendar',
                'title' => '添加日历提醒',
                'desc' => '定时提醒，养成看书好习惯',
                'point' => 30,
                'display' => 1,
                'sort' => 3,
                'event' => [
                    'title' => '邀请您继续读书！',
                    'description' => '点击链接继续阅读吧：',
                    'startDate' => '20:00:00',
                    'endDate' => '22:10:00',
                    'rrule' => 'FREQ=DAILY;INTERVAL=1',
                    'remindMinutes' => [5, 20],
                ]
            ],
            'read' => [
                'key' => 'read',
                'title' => '累计阅读',
                'desc' => '当日阅读单本书满30章就可领取',
                'point' => 30,
                'display' => 1,
                'chapter_num' => 30,
                'sort' => 4,
            ],
            'pay_give' => [
                'key' => 'pay_give',
                'title' => '充值有礼',
                'desc' => '成功充值任意金额即可领取',
                'point' => 50,
                'display' => 1,
                'sort' => 5,
            ],
        ];
    }
}